﻿Public MustInherit Class AbstractAttribute

    Protected field As String, value As String, insertSQL As Boolean, type As String, label As String

    Public Sub New(ByVal f As String, ByVal v As String, ByVal t As String)

        Me.field = f
        Me.value = v
        Me.type = t
        Me.insertSQL = False

    End Sub

    Public Property isDbAtt As Boolean

        Get
            Return Me.insertSQL
        End Get
        Set(ByVal value As Boolean)
            Me.insertSQL = value
        End Set

    End Property

    Public Property attV As String

        Set(ByVal value As String)
            Me.insertSQL = True
            Me.value = AccessDB.returnValueString(value, Me.type)
        End Set
        Get
            Return Me.value
        End Get
    End Property

    Public Function getData(ByVal info As String) As String

        Select Case info

            Case "field"
                Return Me.field

            Case "type"
                Return Me.type

            Case "label"
                Return Me.label

        End Select

        Dim dataNotFound As New Exception(message:="The requested data does not exist")
        Throw dataNotFound

    End Function

End Class
